package BasicClass.Four;

import java.util.HashMap;
import java.util.HashSet;

public class HashTest {
    public static void main(String[] args) {

        HashMap<Stu, Integer> map = new HashMap<>();

        Stu stu = new Stu(1);
        Stu o = stu;

        map.put(stu,1);

        System.out.println(map.get(o));//结果：1,能查询出来

        HashSet<Integer> hash = new HashSet<>();

        Integer o1 = 1563254;
        Integer o2 = 1563254;

        hash.add(o1);

        System.out.println(hash.contains(o2));//结果：true
    }

    static class Stu{
        int value;
        Stu(int V){
            value = V;
        }
    }
}
